#include <stdio.h>
#include <NDL.h>
#include <string.h>

int main() {
  NDL_Init(0);
  while (1) {
    char buf[64];
    int len = NDL_PollEvent(buf, sizeof(buf));
    if ( len != 0) {
      char keydown,keyname[32];
      buf[len] = '\0';
      sscanf(buf,"k%c %s",&keydown,keyname);
      
      if(strcmp("NONE",keyname) == 0) continue;
      else  printf("receive event: %s\n", buf);
    }
  }
  return 0;
}
